package processcontrol;

/**
 * @author shkstart
 * @date 2022/4/8 - 22:07
 */
public class IfTest {
    public static void main(String[] args) {
        int i, sum = 0, count = 0;
        for(i = 1; i <= 100; i++) {
            if ( i % 2 == 0 ) {
                System.out.println(i);
                count++;
                sum += i;
            }

        }
        System.out.println("总和：" +sum );
        System.out.println("个数：" +count );


//      2.
/*        int j = 0;
        for(j = 1; j <= 150; j++ ) {
            if (j % 3 == 0 ) {
                System.out.println(+j +"foo");
            }else if (j % 5 == 0 ) {
                System.out.println(+j +"biz");
            }else if (j % 7 == 0 ) {
                System.out.println(+j +"baz");
            }else {
                System.out.println(+j +" ");
            }
        }*/
//  自己的错误编程！！！！！！



        int j = 0;
        for(j = 1; j <= 150; j++ ) {
            System.out.print(+j +" ");
            if (j % 3 == 0 ) {
                System.out.print(" foo");
            }
            if (j % 5 == 0 ) {
                System.out.print(" biz");
            }
            if (j % 7 == 0 ) {
                System.out.print(" baz");
            }
            System.out.println();
        }
//        老师的正确编程！！！！！！！！！！！
    }
}


